<!DOCTYPE html>
<?php 
	//开启session
		session_start();
	//引入配置文件
		include('../public/config.php');
		//var_dump($_POST);
		$id=$_GET['id'];
		$number=$_GET['number'];
		if(empty($id)||empty($number)){
			$arr=array();
			$arr=$_SESSION['shop'];
		}
?>
<html lang="zh-CN">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Language" content="zh-CN" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>确认提交订单 - 大唐天宝</title>
        <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
        <link rel="Stylesheet" type="text/css" charset="utf-8" href="../public/stylesheet/other/order_3.css" />
        <!--[if IE 6]>
        <script type="text/javascript">document.execCommand("BackgroundImageCache", false, true);</script>
        <![endif]-->
        
    <link rel="Stylesheet" type="text/css" charset="utf-8" href="../public/stylesheet/other/order_4.css" />

    </head>
    <body class="checkout">
        <div id="wrapper">
            <div id="header" class="clearfix">
                    <a class="logo" href="http://www.vancl.com/" title="大唐天宝" target="_blank">
                        <img alt="大唐天宝"  src ="../public/images/logol.png" />
                    </a>
                    <div class="help-center">
                        <a href="http://help.vancl.com/" target="_blank">帮助中心</a>
                    </div>
                    <div class="account">
                            <p>您好，<span class="username"></span><a class="logout" href="#">退出登录</a>|<a class="switch" href="#">更换用户</a></p>

                    </div>
            </div>
            <div id="location">
                
    <span><a href="#">1.我的购物车</a></span> <em>2.填写核对信息单</em> <span>3.成功提交订单</span>

            </div>
            <div id="content">
                


<div class="wrapper clearfix">    
    <section class="order-info">
        <div id="addr" class="addr">
                <div class="addr-hd inland-addr-hd clearfix">

        
<h3  class="addr-title">收货地址：</h3>    </div>
<section class="inland-addr">
<div class='add-addr-panel'><input class='fix-ckb-radio' id='add-addr' name='AddressId' checked='checked' type='radio' value='0' data-url='/checkout/showaddaddress?isforeign=false' /><label for='add-addr'>添加新地址</label></div>    <div class="addr-form">
<form id="set-addr-form" action="./doorders.php" method ="post">
    <ol>
        
        <li>
            <div><span>*</span> 收&nbsp; 货&nbsp; 人：</div>
            <div>    
                <input type="text" id="addressee" name="AddressName" maxlength="20" autofocus="true"
                    placeholder="请准确填写真实姓名" class="place-holder"
                     value="" />
                <p class="error"></p>
            </div>
            <div class="go-other-nation">
            <a  href="/checkout/ExpandAddress?isforeign=true">去填写海外地址&raquo;</a>
            </div>
        </li>
        <li>
            <div><span>*</span> 地　　区：</div>
				<select name="Area">
					<option value="1">北京</option>
					<option value="1">河南</option>
					<option value="1">河北</option>
					<option value="1">广州</option>
					<option value="1">台湾</option>
					<option value="1">香湾</option>
				
				</select>
           <!--  <div>
              <p class="error">请选择省份</p>
            </div>
            <div>
              <p class="error">请选择市</p>
            </div>
            <div>
              <p class="error">请选择县/区</p>
            </div> -->
        </li>
        <li>
            <div><span>*</span> 详细地址：</div>
            <div>
                <div id="province-in-detail"></div>
                <div id="city-in-detail"></div>
                <div id="area-in-detail"></div>
                <input type="text" id="addr-detail" class="addr-detail place-holder" 
                name="Address" maxlength="80" 
                placeholder="请填写详细路名及门牌号" value="" />  
                <a href="http://help.vancl.com/category/transfer" target="_blank"> 配送范围与配送时间 </a>
                <p class="error"></p>
            </div>            
        </li>
        <li>
            <div><span>*</span> 邮政编码：</div>
            <div>
                <input type="text" placeholder="请填写正确的邮政编码" id="postal-code" name="Code"
                 class="place-holder" value="" maxlength="6" />
                <span id="default-postal-code"></span><a id="use-postal-code">使用此邮编</a>
                <p class="error"></p>
            </div>            
        </li>
        <li>
            <div>&nbsp;&nbsp;手　　机：</div>
            <div>
                <input type="text" id="mobile-phone" name="Phone" class="mobile place-holder" placeholder="手机和座机至少填写一个"
                 value="" data-error="请输入正确的手机号码"
                  maxlength="11" />
                <p class="error"></p>
            </div>
            <div>座    机：</div>
            <div>
                <input type="text" id="phone" class="phone" name="Tel" placeholder="手机和座机至少填写一个"
                 value="" data-error="请输入正确的电话号码"
                  maxlength="20" />
                <span id="default-area-code"></span><a id="use-area-code">使用此区号</a>
                <p class="error"></p>
            </div>           
        </li>
        <li>
            <!--<input type="hidden" name="model.AddressId" value="0" />-->
           <input type="submit" class="save-new-addr track"  value="" /><!--name="sp_cart_address_save"-->
        </li>
    </ol>
</form>
<script type="text/javascript">
    $(document).ready(function () {
        $("#province-id option").each(function () {
            var valContent = decodeURI($(this).val());
            if (valContent == "澳门特别行政区" || valContent == "香港特别行政区" || valContent == "台湾省") {
                $(this).remove();
            }
        });
    });
</script>
    </div>
</section>

        </div>
        <div id="delivery" class="delivery">
            <h3>配送方式：</h3><div class='warn'>请先确认“收货地址”</div>
        </div>
        <div id="pay" class="pay">
                <div class="pay-hd clearfix">
        <h3 class='pay-title'>支付方式：</h3>
    </div>    

    余额支付</div>
        <div id="virtual-account" class="virtual-account">
                <section>
    </section>

        </div>
    </section>
    <div id="order-info-panel">
        <div id="all-tips" data-tips="">
</div>
<!--订单显示-->
<form method="post" action="/checkout/save" name="Myform" id="submit-order-form">
    <div class="order-info-head">
    <h3 class="clearfix">
        <span class="order-list-title">商品清单</span>
        <a name="sp_cart_gift_back_cart" class="back2cart track" href="./cart.php">
                                                       回到购物车，修改产品>></a>
        
        
    </h3>
    </div>
   
        <h5 class="order-list-head">订单1<span class="store-house-info">将从<em></em>发出，预计发货后<em>1天</em>内送达</span></h5>
        <div class="order-list clearfix">
                    <div class="order-list-shop">
                     店铺:<span class="store-house-shop">
                            <a href="./index.php">大唐天宝</a>
                     </span>
                     </div>
                <table>
                    <thead>
                        <tr>
                            <th>
                                商品名称
                            </th>
                            <th>
                                尺码
                            </th>
                            <th>
                                赠送积分
                            </th>
                            <th>
                                单价
                            </th>
                            <th>
                                数量
                            </th>
                            <th>
                                优惠
                            </th>
                            <th>
                                小计
                            </th>
                        </tr>
                    </thead>
                    <tbody>
						<?php 
							//导入配置文件
							include('../public/config.php');
							//连接数据库
							$con=@mysql_connect(HOST,USER,PASS) or die('连接数据库失败！');
							//选择数据库和设置字符集
							mysql_select_db(DBNAME,$con);
							mysql_set_charset('utf8');
								if(!empty($id)&&!empty($_POST['number'])){
									$_SESSION['shop'][$id]=$_POST['number'];
								}
							//取出键值
								$keystr=array_keys($_SESSION['shop']);
								$idstr=implode(',',$keystr);
							//编写sql语句
							$sql="select id,goods,price from goods where id in ({$idstr})";
							//执行sql语句
							$result = mysql_query($sql);
							//解析结果集并遍历输出
							if(empty($result)){
								echo "";
							}else{
							while($row = mysql_fetch_assoc($result)){
						?>
                            <tr>
                                <td class="name">
                                    <a target="_blank" href="#"><?php echo $row['goods']; ?></a>
                                </td>
                                <td class="size">XL
                                </td>
                                <td class="point">58
                                    分
                                </td>
                                <td class="price">
                                    ￥<?php echo $row['price']; ?>
                                </td>
                                <td class="qty"><?php echo $_SESSION['shop'][$row['id']]; ?>
                                </td>
                                <td class="preferential">
                                    <div class="discount-cx">
                                            -
                                    </div>
                                </td>
                                <td class="sub-total">
                                    ￥<?php $subtotal=($row['price']*$_SESSION['shop'][$row['id']]);$total+=$subtotal;echo $subtotal; ?>
                                </td>
                            </tr>
				<?php }
					}
				?>
                            <!--<tr>
                                <td class="name">
                                    <a target="_blank" href="#">凡客衬衫裙 牛仔布 女款 蓝色</a>
                                </td>
                                <td class="size">XL
                                </td>
                                <td class="point">84
                                    分
                                </td>
                                <td class="price">
                                    ￥168.00
                                </td>
                                <td class="qty">1
                                </td>
                                <td class="preferential">
                                    <div class="discount-cx">
                                            -
                                    </div>
                                </td>
                                <td class="sub-total">
                                    ￥168.00
                                </td>
                            </tr>-->
                    </tbody>
                </table>
            <div class="order-amount">
                商品金额小计:<span><?php echo $total; ?></span> &nbsp;&nbsp;+&nbsp;&nbsp;运费:<span>￥<?php $fare=0;echo $fare; ?></span>
                &nbsp;&nbsp;=&nbsp;&nbsp;应付:<em><?php $newtotal=($total+$fare);echo $newtotal; ?></em>
            </div>
        </div>
    <ul class="all-amount">
        
        <li><em>您共需要为订单支付：<label id="price-total" data-price-total="286.00">￥<?php echo $newtotal;?></label></em></li>
    </ul>

    <div class="additional-info">
        <h4 class="collapse">
            订单备注</h4>
        <div class="additional-info-content">
            
            <div>
                <textarea id="comments" name="comments" class="place-holder" placeholder="此处请勿填写有关配送、支付等方面的信息。留言请在50字以内"></textarea>
                <p class="error">
                </p>
            </div>
        </div>
            <h4 class="collapse">
                开发票</h4>
        <div class="additional-info-content" >
            <h5>
                您需要开具发票吗？
                    <input type="radio" id="IsInvoicePositive" name="requireInvoice" value="true" />
                    <label for="IsInvoicePositive">
                        是</label>
                    <input type="radio" id="IsInvoiceNegative" name="requireInvoice" checked="checked"
                           value="false" />
                    <label for="IsInvoiceNegative">
                        否</label>
            </h5>
            <div class="additional-info-detail invoice-content">
                <span>*</span><label for="InvoiceCustom">客 户 类 型：</label>
                    <select id="InvoiceCustom" name="InvoiceCustom" disabled="disabled">
                            <option value="Personal">个人</option>
                            <option value="Company">公司</option>
                            <option value="IndividualBusiness">个体工商户</option>
                            <option value="Foreign">外籍</option>
                            <option value="Hkmotw">港、澳、台</option>
                    </select>
            </div>
            <div class="additional-info-detail clearfix">
                <div>
                    <span>*</span>发 票 抬 头：</div>
                <div>
                        <input id="InvoiceTitle" class="invoice-title" type="text" name="invoicetitle" disabled="disabled"
                               maxlength="50" />
                        <input id="InvoiceTitlePerson"  class="invoice-title-person" type="text" name="invoicetitle" maxlength="50" disabled="disabled" value="个人" />
                    <p class="error">
                    </p>
                </div>
            </div>
            <div class="additional-info-detail invoice-content">
                <span>*</span><label for="InvoiceContent">发 票 内 容：</label>
                    <select id="invoiceContent" name="InvoiceContent" disabled="disabled">
                            <option value="Clothes">服装</option>
                            <option value="Shoes">鞋</option>
                            <option value="Household">家居</option>
                            <option value="Accessories">配饰</option>
                            <option value="Cosmetics">化妆品</option>
                            <option value="Electrical">家电</option>
                            <option value="Bags">箱包</option>
                            <option value="Details">明细</option>
                    </select>
            </div>
            <div id="invoice-tax" class="additional-info-detail clearfix">
                <div class="invoice-tax">
                    税务登记号：</div>
                <div>
                        <input id="InvoiceTaxNo" class="invoice-title" type="text" name="InvoiceTaxNo" disabled="disabled"
                               maxlength="20" />
                    <p class="error">
                    </p>
                </div>
            </div>
        </div>
            <input type="hidden" name="requireedm" value="true" />
    </div>
    <div class="order-submit clearfix">
        <input type="submit" id="submit-order-btn" style="background-color:#2960cc" value="提交订单" class="submit-order-btn track" name="sp_cart_submit_order" />
        <span class="warn oprate"></span>
    </div>
        <!--特惠品移除提示-->
</form>

    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $("#province-id option").each(function () {
            var valContent = decodeURI($(this).val());
            if (valContent == "澳门特别行政区" || valContent == "香港特别行政区" || valContent == "台湾省") {
                $(this).remove();
            }
        });
    });
</script>
            </div>
            <div id="footer">
                    <p class="copyrights">Copyright 2007 - 2015 vancl.com All Rights Reserved 京ICP证100557号 京公网安备11010102000579号 出版物经营许可证新出发京批字第直110138号</p>
                    <p class="certs">
                        <a class="ectrustprc" title="中国电子商务诚信单位" href="http://www.ectrustprc.org.cn/seal/splash/1000020.htm" target="_blank">
                            <img alt="中国电子商务诚信单位" src="//ssl.vanclimg.com/shopping/cert-redlogo.gif" />
                        </a>
                        <span class="costumeorg" title="中国服装协会会员单位">
                            <img alt="中国服装协会会员单位" src="//ssl.vanclimg.com/shopping/cert-costumeorg.gif" />
                        </span>
                        <a class="online315" href="http://www.315online.com.cn/member/315090053.html" title="网上交易保障中心" target="_blank">
                            <img alt="网上交易保障中心" src="//ssl.vanclimg.com/shopping/cert-wsjybzzx.gif" />
                        </a>
                    </p>
            </div>
        </div>       
          
    <!--[if ie 6]>
    <script type="text/javascript" src="//js.vancl.com/js.ashx?href=/shopping/jquery/jquery.bgiframe.min.js&compress"></script>   
    <![endif]-->  

        <script type="text/javascript" src="//js.vancl.com/js.ashx?href=[/public/trace.js,ct.js]&compress"></script>
    </body>
</html>
